﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SGS.Standard.EventArgs;
using SGS.Cards;

namespace SGS.Standard.Actor
{
    public class DiscardStageHumanAnswerActor : ActorBase
    {
        public DiscardStageHumanAnswerActor( IEnumerable<Card> cards )
        {
            Discards = new List<Card>( cards );
        }

        public override string ActocName
        {
            get { return "弃牌阶段-用户应答"; }
        }
        
        public static new ActorBase Default
        {
            get
            {
                return new DiscardStageHumanAnswerActor( null );
            }
        }

        public List<Card> Discards
        {
            get;
            protected set;
        }

        public override bool CheckHumanActor(HumanActorEventArgs e)
        {
            if (Discards.Count != ((e.SourceActor) as DiscardStageActor).NeedDiscardCount)
            {
                return false;
            }

            foreach (var card in Discards)
            {
                if (!e.AnswerPlayer.GameInfo.OwnCards.Contains(card))
                {
                    return false;
                }
            }

            return true;
        }

        /*public override void OnAct(object sender, GameContext gctx)
        {
            base.OnAct(sender, gctx);
        }*/
    }
}
